package com.haochang.chunkvod.model.order;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import android.os.Parcel;
import android.os.Parcelable;

/**
 *@author qintao
 *created at 2016/6/8 9:54
 * 分区信息
 */
@DatabaseTable(tableName = "tb_part")
public class PartInfo implements Parcelable
{
	@DatabaseField(columnName = "part_name")
	private String partName;
	@DatabaseField(columnName = "part_id", id = true)
	private String part_id;
	private String branch_id;
	private String floor_id;
	@DatabaseField(columnName = "isSelect")
	private boolean isSelect;
	@DatabaseField(columnName = "is_room_select")
	private boolean isRoomSelect = true;
	@DatabaseField(columnName = "is_table_select")
	private boolean isTableSelect = true;

	public PartInfo()
	{
	}

	protected PartInfo(Parcel in)
	{
		partName = in.readString();
		part_id = in.readString();
		branch_id = in.readString();
		floor_id = in.readString();
		isSelect = in.readByte() != 0;
		isRoomSelect = in.readByte() != 0;
		isTableSelect = in.readByte() != 0;
	}

	public static final Creator<PartInfo> CREATOR = new Creator<PartInfo>()
	{
		@Override
		public PartInfo createFromParcel(Parcel in)
		{
			return new PartInfo(in);
		}

		@Override
		public PartInfo[] newArray(int size)
		{
			return new PartInfo[size];
		}
	};

	@Override
	public int describeContents()
	{
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags)
	{
		dest.writeString(partName);
		dest.writeString(part_id);
		dest.writeString(branch_id);
		dest.writeString(floor_id);
		dest.writeByte((byte) (isSelect ? 1 : 0));
		dest.writeByte((byte) (isRoomSelect ? 1 : 0));
		dest.writeByte((byte) (isTableSelect ? 1 : 0));
	}

	public String getPartName()
	{
		return partName;
	}

	public void setPartName(String partName)
	{
		this.partName = partName;
	}

	public String getPart_id()
	{
		return part_id;
	}

	public void setPart_id(String part_id)
	{
		this.part_id = part_id;
	}

	public String getBranch_id()
	{
		return branch_id;
	}

	public void setBranch_id(String branch_id)
	{
		this.branch_id = branch_id;
	}

	public String getFloor_id()
	{
		return floor_id;
	}

	public void setFloor_id(String floor_id)
	{
		this.floor_id = floor_id;
	}

	public boolean isSelect()
	{
		return isSelect;
	}

	public void setSelect(boolean select)
	{
		isSelect = select;
	}

	public boolean isRoomSelect()
	{
		return isRoomSelect;
	}

	public void setRoomSelect(boolean roomSelect)
	{
		isRoomSelect = roomSelect;
	}

	public boolean isTableSelect()
	{
		return isTableSelect;
	}

	public void setTableSelect(boolean tableSelect)
	{
		isTableSelect = tableSelect;
	}
}
